<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="libs/jquery-1.12.1.min.js"></script>
</head>
<body>
<div id="a">您好<span id="b">66</span>欢迎登陆</div>

<script type="text/javascript">
/* $(function(){
	var x=$('#a').text();
	var y=$('#b').text();
	var i=x.indexOf("66")
	var x1=x.substring(0,i);
	console.log(x1);
	console.log(i); */
	
	
/* 	var a=function(){};
	var b=function(){};
	b.prototype.a(){};
	function Person(name,age){  
        this.name=name;  
        this.age=age;  
    }  
    Person.prototype.sayHello=function(){  
        alert("使用原型得到Name："+this.name);  
    }  
    var per=new Person("马小倩",21);  
    per.sayHello(); //输出：使用原型得到Name:马小倩 
      function Person(name,age){  
        this.name=name;  
        this.age=age;  
    }  
    Person.prototype.sayHello=function(){  
        alert("使用原型得到Name："+this.name);  
    }  
    var per=new Person("马小倩",21);  
    per.sayHello(); //输出：使用原型得到Name:马小倩  

      
    function Student(){}  
    Student.prototype=new Person("洪如彤",21);  
    var stu=new Student();  
    Student.prototype.grade=5;  
    Student.prototype.intr=function(){  
        alert(this.grade);  
    }  
    stu.sayHello();//输出：使用原型得到Name:洪如彤  
    stu.intr();//输出：5  */
	
    
	/* $(function(){
	    var init =function(){
	    	for(var i=1;i<4;i++){
	    		setTimeout(function(){
	    			document.write(i+',');
	    		},0)
	    	}
	    }
	    init();
	})   */ 
	
	
	$(function(){
		var init=function(){
			ducoument.write(a);
			this.method=function(){
				a=5;
				document.write(a);
			}();
			document.write(a);
			var a=10;
			document.write(a);
		}
		init();
	})
	
</script>
</body>
</html>